import type { Meta, StoryObj } from '@storybook/nextjs-vite';

import DisplayPanel from './displayPanel'
import { DisplayPanelProps } from './displayPanel.interface';
import { NodeItems } from '../schemas/panelInterface';


// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
  title: 'Components/FilePanel/DisplayPanel',
  component: DisplayPanel,
  parameters: {
    // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
    layout: 'fullscreen',
  },
  // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
  tags: ['autodocs'],
  // More on argTypes: https://storybook.js.org/docs/api/argtypes
  argTypes: {
    nodeItem_list: {control: 'object'},
    currentPath: {control: 'text'},
  },
} satisfies Meta<typeof DisplayPanel>;

export default meta;
type Story = StoryObj<typeof meta>;


const nis: NodeItems = [
        {
          Name: 'Documents',
          path: '/Documents',
          modifiedTime: new Date().toISOString(),
          isDirectory: true,
          FileType: ''
        },
        {
          Name: 'Pictures',
          path: '/Pictures',
          modifiedTime: new Date().toISOString(),
          isDirectory: true,
          FileType: ''
        },
        {
          Name: 'report.pdf',
          path: '/report.pdf',
          size: 1024 * 1024 * 2, // 2MB
          modifiedTime: new Date().toISOString(),
          isDirectory: false,
          FileType: 'pdf'
        }
      ]

// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
export const Default: Story = {
  args: {
    nodeItem_list: nis,
    currentPath: 'C:\\filecube\\',
  }, 
}
